Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __SPEECHRECOGNITION__
#define __SPEECHRECOGNITION__
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif
#ifndef __MIXEDMODE__
#include <MixedMode.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
/* Error Codes [Speech recognition gets -5100 through -5199] */
enum {
kSRNotAvailable = -5100, /* the service requested is not avail or applicable */
kSRInternalError = -5101, /* a system internal or hardware error condition */
kSRComponentNotFound = -5102, /* a needed system resource was not located */
kSROutOfMemory = -5103, /* an out of memory error occurred in the toolbox memory space */
kSRNotASpeechObject = -5104, /* the object specified is no longer or never was valid */
kSRBadParameter = -5105, /* an invalid parameter was specified */
kSRParamOutOfRange = -5106, /* when we say 0-100, don't pass in 101. */
kSRBadSelector = -5107, /* an unrecognized selector was specified */
kSRBufferTooSmall = -5108, /* returned from attribute access functions */
kSRNotARecSystem = -5109, /* the object used was not a SRRecognitionSystem */
kSRFeedbackNotAvail = -5110, /* there is no feedback window associated with SRRecognizer */
kSRCantSetProperty = -5111, /* a non-settable property was specified */
kSRCantGetProperty = -5112, /* a non-gettable property was specified */
kSRCantSetDuringRecognition = -5113, /* the property can't be set while recognition is in progress -- do before or between utterances. */
kSRAlreadyListening = -5114, /* in response to SRStartListening */
kSRNotListeningState = -5115, /* in response to SRStopListening */
kSRModelMismatch = -5116, /* no acoustical models are avail to match request */
kSRNoClientLanguageModel = -5117, /* trying to access a non-specified SRLanguageModel */
kSRNoPendingUtterances = -5118, /* nothing to continue search on */
kSRRecognitionCanceled = -5119, /* an abort error occurred during search */
kSRRecognitionDone = -5120, /* search has finished, but nothing was recognized */
kSROtherRecAlreadyModal = -5121, /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
kSRHasNoSubItems = -5122, /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
kSRSubItemNotFound = -5123, /* returned when accessing a non-existent sub item of a container */
kSRLanguageModelTooBig = -5124, /* Cant build language models so big */
kSRAlreadyReleased = -5125, /* this object has already been released before */
kSRAlreadyFinished = -5126, /* the language model can't be finished twice */
kSRWordNotFound = -5127, /* the spelling couldn't be found in lookup(s) */
kSRNotFinishedWithRejection = -5128, /* property not found because the LMObj is not finished with rejection */
kSRExpansionTooDeep = -5129, /* Language model is left recursive or is embedded too many levels */
kSRTooManyElements = -5130, /* Too many elements added to phrase or path or other langauge model object */
kSRCantAdd = -5131, /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject) */
kSRSndInSourceDisconnected = -5132, /* Sound input source is disconnected */
kSRCantReadLanguageObject = -5133, /* An error while trying to create new Language object from file or pointer -- possibly bad format */
/* non-release debugging error codes are included here */
kSRNotImplementedYet = -5199 /* you'd better wait for this feature in a future release */
kSRFeedbackAndListeningModes = FOUR_CHAR_CODE('fbwn'), /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
kSRRejectedWord = FOUR_CHAR_CODE('rejq'), /* the SRWord used to represent a rejection */
kSRCleanupOnClientExit = FOUR_CHAR_CODE('clup') /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
};
enum {
kSRNoFeedbackNoListenModes = 0, /* next allocated recognizer has no feedback window and doesn't use listening modes */
kSRHasFeedbackHasListenModes = 1, /* next allocated recognizer has feedback window and uses listening modes */
kSRNoFeedbackHasListenModes = 2 /* next allocated recognizer has no feedback window but does use listening modes */
};
/* Speech Source Types */
enum {
kSRDefaultSpeechSource = 0,
kSRLiveDesktopSpeechSource = FOUR_CHAR_CODE('dklv'), /* live desktop sound input */
kSRNotifyRecognitionBeginning = 1L << 0, /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
kSRNotifyRecognitionDone = 1L << 1 /* recognition has terminated. result (if any) is available. */
};
/* Apple Event selectors */
/* AppleEvent message class */
enum {
kAESpeechSuite = FOUR_CHAR_CODE('sprc')
};
/* AppleEvent message event ids */
enum {
kAESpeechDone = FOUR_CHAR_CODE('srsd'),
kAESpeechDetected = FOUR_CHAR_CODE('srbd')
};
/* AppleEvent Parameter ids */
enum {
keySRRecognizer = FOUR_CHAR_CODE('krec'),
keySRSpeechResult = FOUR_CHAR_CODE('kspr'),
keySRSpeechStatus = FOUR_CHAR_CODE('ksst')
};
/* AppleEvent Parameter types */
enum {
typeSRRecognizer = FOUR_CHAR_CODE('trec'),
typeSRSpeechResult = FOUR_CHAR_CODE('tspr')
};
/* SRRecognizer Properties */
enum {
kSRNotificationParam = FOUR_CHAR_CODE('noti'), /* see notification flags below */
kSRCallBackParam = FOUR_CHAR_CODE('call'), /* type SRCallBackParam */
kSRSearchStatusParam = FOUR_CHAR_CODE('stat'), /* see status flags below */
kSRAutoFinishingParam = FOUR_CHAR_CODE('afin'), /* automatic finishing applied on LM for search */
kSRForegroundOnly = FOUR_CHAR_CODE('fgon'), /* Boolean. Default is true. If true, client recognizer only active when in foreground. */
kSRBlockBackground = FOUR_CHAR_CODE('blbg'), /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive. */
kSRBlockModally = FOUR_CHAR_CODE('blmd'), /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
kSRWantsResultTextDrawn = FOUR_CHAR_CODE('txfb'), /* Boolean. Default is true. If true, search results are posted to Feedback window */
kSRWantsAutoFBGestures = FOUR_CHAR_CODE('dfbr'), /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
kSRSoundInVolume = FOUR_CHAR_CODE('volu'), /* short in [0..100] log scaled sound input power. Can't set this property */
kSRReadAudioFSSpec = FOUR_CHAR_CODE('aurd'), /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
kSRCancelOnSoundOut = FOUR_CHAR_CODE('caso'), /* Boolean: Default is true. If any sound is played out during utterance, recognition is aborted. */
kSRSpeedVsAccuracyParam = FOUR_CHAR_CODE('sped') /* SRSpeedSetting between 0 and 100 */
};
/* 0 means more accurate but slower. */
/* 100 means (much) less accurate but faster. */
enum {
kSRUseToggleListen = 0, /* listen key modes */
kSRUsePushToTalk = 1
};
enum {
kSRListenKeyMode = FOUR_CHAR_CODE('lkmd'), /* short: either kSRUseToggleListen or kSRUsePushToTalk */
kSRListenKeyCombo = FOUR_CHAR_CODE('lkey'), /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */